package com.example.livesettingtest;

import android.os.Build;
import android.util.Log;

public class CommonUtil {


    /**
     * 得到手机品牌及返回品牌ID  OnePlus
     */
    static public String getMobileBrandId()
    {
        int brandId = -1;
        String brand = (android.os.Build.BRAND);  //品牌系列，如华为公司的 huawei,honor
        String SystemVersion = android.os.Build.VERSION.RELEASE;  //手机android系统版本号
        int SystemSDK_INT = android.os.Build.VERSION.SDK_INT;  //手机android系统版本号

        String lowerLetterBrand = brand.toLowerCase();
        Log.i("brand","brand="+lowerLetterBrand+",SystemVersion="+SystemVersion+",SystemSDK_INT="+SystemSDK_INT);
        /*  String sdkVersion = android.os.Build.VERSION.SDK;
        String sdkRelease = android.os.Build.VERSION.RELEASE;*/
        switch (lowerLetterBrand)
        {
            case MyConstant.HUAWEI:
            case MyConstant.HUAWEI_HONOR:  //华为荣耀
                brandId = 1;  //代表华为
                break;
            case MyConstant.MI:
                brandId = 2;
                break;
            case MyConstant.OPPO:
                brandId = 3;
                break;
            case MyConstant.VIVO:
                brandId = 4;
                break;
            case MyConstant.OPPO_ColorOS:  //oppo
                brandId = 3;
                break;
        }
        return lowerLetterBrand;
    }
    /**
     * 根据手机品牌的ID返回URL
     * /*
     */

    static public String getAppLiveSettingUrl(int brandId)
    {

        /*  String sdkVersion = android.os.Build.VERSION.SDK;
        String sdkRelease = android.os.Build.VERSION.RELEASE;*/
        String url = "";

        switch (brandId)
        {
            case 1:  //HUAWEI
                url = MyConstant.HTML_ROOT+"huaweilist.html";
                break;
            case 2: //MI
                url = MyConstant.HTML_ROOT+"xiaomilist.html";
                break;
            case 3: //OPPO
                url = MyConstant.HTML_ROOT+"oppolist.html";
                break;
            case 4: //VIVO
                url = MyConstant.HTML_ROOT+"vivolist.html";
                break;
            default:  //ALL
                url = MyConstant.HTML_ROOT+"app-live.html";
                break;

        }
        return url;
    }

}
